//
//  DYJScrollViewCell.m
//  Piece
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//

#import "DYJScrollViewCell.h"
#import "UIImageView+WebCache.h"

@implementation DYJScrollViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.scrollViewImageView = [[UIImageView alloc] init];
        self.scrollViewImageView.contentMode = UIViewContentModeScaleAspectFill;
        [self.contentView addSubview:_scrollViewImageView];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.scrollViewImageView.frame = self.bounds;
}
- (void)setModel:(DYJScrollViewModel *)model
{
    if (_model != model) {
        _model = model;
        [self.scrollViewImageView sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:[UIImage imageNamed:@"xph"]];
        
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
